<template>
	<view class="accessoryManagement-container">
		<view class="accessoryManagement-container-nav" v-for="item in iconArray" @click="navItemClick(item)">
			<image class="nav-img" :src="item.src"></image>
			<view class="nav-text">{{item.text}}</view>
			<view class="nav-left">
				<image class="nav-leftimg" src="../../../../static/assets/public/left.png"></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				iconArray: [{
						index: "1",
						src: "../../../../static/assets/homepage/partsDelivery.png",
						text: this.$t('public.partOutStorage'),
					},
					{
						index: "2",
						src: "../../../../static/assets/homepage/orderInfo.png",
						text: this.$t('public.checkStorage'),
					},
					{
						index: "3",
						src: "../../../../static/assets/homepage/warehouseManage.png",
						text: this.$t('homepage.WarehouseManage.warehouseManage'),
					},
					{
						index: "4",
						src: "../../../../static/assets/homepage/requisition.png",
						text: this.$t('homepage.WarehouseManage.requisition'),
					}
				]
			}
		},
		onPullDownRefresh() {
			setTimeout(function() {
				uni.redirectTo({
					url: "/pages/HomePage/WarehouseMange/StorageManagement/accessoryManagement/index"
				})
				uni.stopPullDownRefresh();
			}, 1000);
		},
		methods: {
			// 导航点击的处理函数
			navItemClick(item) {
				if (item.index == 1) {
					uni.navigateTo({
						url: "./ScanDelivery/index"
					})
				} else if (item.index == 2) {
					uni.navigateTo({
						url: "./InventoryQuery/index"
					})
				}  else if (item.index == 3) {
					uni.navigateTo({
						url: "./WarehouseManage/index"
					})
				} else if (item.index == 4) {
					uni.navigateTo({
						url: "./Requisition/index"
					})
				} 
			},
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #F6F7FB;
	}

	.accessoryManagement-container {
		margin: 10px 0;

		.accessoryManagement-container-nav {
			background-color: #FFFFFF;
			height: 30px;
			padding: 12px;
			display: flex;
			border-bottom: 1px solid #eaebee;

			.nav-img {
				width: 30px;
				height: 30px;
			}

			.nav-text {
				font-size: 16px;
				text-indent: 2px;
				margin: 3px 8px;
			}

			.nav-left {
				margin-top: 6px;
				margin-left: 50%;
			}

			.nav-leftimg {
				width: 20px;
				height: 20px;
			}
		}
	}
</style>
